import { getAntComDefaultConfig } from './src/ant'
import { getVueComDefaultConfig } from './src/vue'
import { getHtmlComDefaultConfig } from './src/html'
import { getVantComDefaultConfig } from './src/vant'
import { getVxeComDefaultConfig } from './src/vxe'
import { getBwComDefaultConfig } from './src/bwCom'

import {
  BwComTypeEnum,
  BwVueComNameEnum,
  BwAntComNameEnum,
  BwHtmlComNameEnum,
  BwVanComNameEnum,
  BwVxeComNameEnum,
  BwBwComNameEnum,
} from '../render/enums'

import type { BwDesignNodeComDefaultOptionModel } from './model'

/** 获取组件默认配置 */
export function getComDefaultOptions(type: BwComTypeEnum, comCode: string) {
  let data: BwDesignNodeComDefaultOptionModel = {
    attrs: null,
    enableSlotList: null,
  }

  switch (type) {
    case BwComTypeEnum.ant: {
      data = getAntComDefaultConfig(comCode as BwAntComNameEnum)
      break
    }
    case BwComTypeEnum.html: {
      data = getHtmlComDefaultConfig(comCode as BwHtmlComNameEnum)
      break
    }
    case BwComTypeEnum.vue: {
      data = getVueComDefaultConfig(comCode as BwVueComNameEnum)
      break
    }
    case BwComTypeEnum.vant: {
      data = getVantComDefaultConfig(comCode as BwVanComNameEnum)
      break
    }
    case BwComTypeEnum.vxe: {
      data = getVxeComDefaultConfig(comCode as BwVxeComNameEnum)
      break
    }
    case BwComTypeEnum.bw: {
      data = getBwComDefaultConfig(comCode as BwBwComNameEnum)
    }
  }

  return data
}
